###
 # @Author: didiplus
 # @Description: 
 # @Date: 2025-06-19 16:52:32
 # @LastEditors: didiplus
 # @LastEditTime: 2025-06-19 16:52:48
 # @FilePath: /script/SecGuardian/modules/tools_function.sh
 # @Version: 1.0
### 


# 检测系统发行版
detect_os() {
    if [ -f /etc/redhat-release ]; then
        echo "redhat"  # RHEL/CentOS
    elif [ -f /etc/debian_version ]; then
        echo "debian"  # Debian/Ubuntu
    elif [ -f /etc/SuSE-release ] || grep -q "SUSE" /etc/os-release 2>/dev/null; then
        echo "suse"    # SUSE/SLES
    else
        echo "unknown"
    fi
}